/** 升降柱 */
import { Get, Post, PostJson, PostForm } from './request';

interface ILifting {
    controlId: number, // 控制箱Id
    createId: number,
    createTime: string, // "2020-06-16 22:08:36"
    groupId: number, // 分组id
    id: number, 
    orderNum: number,
    status: number, // 状态
    updateTime: string, // "2020-06-17 22:34:25"
}

export enum ILiftingOperate {
    up = 1,
    down = 2,
    allUp = 3,
    allDown = 4
}
export enum ILiftStatus {
    down = 0,
    up = 1,
    error = 2
}
/** 获取所有柱子信息 */
export const getAllLiftingApi = () => Get('/lifting/all')

/** 删除升降柱
 * ids
 */
export const deleteLiftingApi = (data: any) => Post('/lifting/delete', data)

/** 获取区域内柱子
 * areaId
 */
export const getLiftingByAreaApi = (params: any): Promise<ILifting[]> => Get('/lifting/getByArea', params)

/** 获取柱子列表 */
export const getLiftingListApi = (data: any) => Post('/lifting/list', data)

/** 操作升降柱
 * ids
 * type
 * areaId
 */
export const operateLiftingApi = (data: any) => PostForm('/lifting/operate', data)